package main

import (
	"fmt"
	"golang-step/day23/goroutine"
	"os"
)

//
func main() {
	file, err := os.Open("day23/defer.txt")
	if err != nil {
		fmt.Println(err.Error())
		return
	}
	defer file.Close()
	//read file
	stat, err := file.Stat()
	bs := make([]byte, stat.Size())
	_, err = file.Read(bs)
	content := string(bs)
	fmt.Println(content)

	//调用计数器示例
	goroutine.Multiple()

	//复数使用
	var complexVar = 2 + 3i
	r := real(complexVar)
	i := imag(complexVar)
	fmt.Println(r)
	fmt.Println(i)
	v1, v2 := 1, 2
	fmt.Println(v1, v2)
}
